package cn.yyh.system.service.impl;

import cn.yyh.basic.service.impl.BaseServiceImpl;
import cn.yyh.basic.utils.PageInfo;
import cn.yyh.org.query.BaseQuery;
import cn.yyh.system.domain.SystemDictionaryDetail;
import cn.yyh.system.mapper.SystemDictionaryDetailMapper;
import cn.yyh.system.service.ISystemDictionaryDetailService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 杨永航
 * @version 1.0
 * @Title: SystemDictionaryDetailServiceImpl
 * @Package: cn.yyh.system.service.impl
 * @date 2021/6/28
 */
@Service
public class SystemDictionaryDetailServiceImpl extends BaseServiceImpl<SystemDictionaryDetailMapper, SystemDictionaryDetail> implements ISystemDictionaryDetailService {


    @Override
    public PageInfo<SystemDictionaryDetail> pageQuery(Long id, BaseQuery query) {
        Integer count = baseMapper.countByQuery(id, query);
        List<SystemDictionaryDetail> list = baseMapper.pageQuery(id, query);
        PageInfo<SystemDictionaryDetail> info = new PageInfo<>();
        info.setTotals(count);
        info.setRows(list);
        return info;
    }

    @Override
    public List<SystemDictionaryDetail> listDetails(Long id) {

        return baseMapper.listDetails(id);
    }
}
